import 'package:flutter/cupertino.dart';
import 'package:flutter/services.dart';

class PolyvUtils {
  static const _channel = const MethodChannel('plugins.polyv/util');
  static String mAppId;
  static String mAppSecret;

  static Future<String> playerConfig({
    @required String config,
    @required String aesKey,
    @required String iv,
    @required String appId,
    @required String appSecret,
  }) async {
    mAppId = appId; mAppSecret = appSecret;
    return await _channel.invokeMethod('playerConfig', {
      "config": config,
      "aesKey": aesKey,
      "iv": iv,
      "appId": appId,
      "appSecret": appSecret,
    });
  }

  static Future<String> getFirstImage({@required String vid}) async {
    return await _channel.invokeMethod('getFirstImage', {"vid": vid});
  }
}
